package com.woniu.user.schedul;

import com.woniu.user.service.TUserWhiteService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * @author 杜梅杰
 * @description 白名单初始化定时任务
 * @date 2024/5/8 19:09
 */
@Component
@Slf4j
public class WhiteScheduling {
    @Autowired
    private TUserWhiteService whiteService;

//    @Scheduled(cron = "秒 分 时 日 月 年") 1 2 4 * * ?
    @Scheduled(fixedDelay = 60 * 1000)
    public void initWhite() {
        log.info("initWhite begin");
        whiteService.initWhite();
        log.info("initWhite end");
    }
}
